Skip to content

feat: add virtiofsd for dir passthrough#11

Open
tulilirockz wants to merge 3 commits intoflathub:masterfrom
tulilirockz:virtiofsd
Open

feat: add virtiofsd for dir passthrough#11
tulilirockz wants to merge 3 commits intoflathub:masterfrom
tulilirockz:virtiofsd

Conversation

@tulilirockz
Copy link
Collaborator

@tulilirockz tulilirockz commented Jan 29, 2025

Adds virtiofsd for directory passthrough! Should work ootb.

Fixes: #10

@flathubbot
Copy link
Contributor

Started test build 177191

@flathubbot
Copy link
Contributor

Build 177191 failed

@flathubbot
Copy link
Contributor

Started test build 177192

@flathubbot
Copy link
Contributor

Build 177192 failed

@flathubbot
Copy link
Contributor

Started test build 177194

@flathubbot
Copy link
Contributor

Build 177194 successful
To test this build, install it from the testing repository:

flatpak install --user https://dl.flathub.org/build-repo/160347/org.virt_manager.virt_manager.Extension.Qemu.flatpakref

@tulilirockz
Copy link
Collaborator Author

tulilirockz commented Jan 29, 2025

Alright. Everything works with workarounds up until
image

This might require another patch like https://github.com/flathub/org.virt_manager.virt-manager/blob/master/libvirt-use-monitor-in-xdg-runtime-dir.patch on libvirt 😭

@tulilirockz
Copy link
Collaborator Author

@flathubbot
Copy link
Contributor

🚧 Test build enqueued.

@flathubbot
Copy link
Contributor

🚧 Started test build.

@flathubbot
Copy link
Contributor

🚧 Test build succeeded. To test this build, install it from the testing repository:

flatpak install --user https://dl.flathub.org/build-repo/185165/org.virt_manager.virt_manager.Extension.Qemu.flatpakref

@twelho
Copy link

twelho commented Sep 21, 2025

Hi, thanks for your hard work on this! The error you're seeing is the dreaded 107 character UNIX socket path limitation. In your case the path /var/home/tulip/.var/app/org.virt_manager.virt_manager/config/libvirt/qemu/lib/domain-6-achillobator/fs0-fs.sock is 112 chars long, have you tested if it would work with a slightly shorter VM name? Of course this isn't ideal, since even the length of one's username affects whether this is usable or not, but least it would enable further evaluation. I will be testing this shortly.

@tulilirockz
Copy link
Collaborator Author

Its been quite a while since I've worked on this pull request, but patching this, just like we've done with Libvirt, might be the way to go! Please report back if you get anything successful :)

@tulilirockz
Copy link
Collaborator Author

bot, build

@flathubbot
Copy link
Contributor

🚧 Test build enqueued.

@flathubbot
Copy link
Contributor

🚧 Started test build.

@flathubbot
Copy link
Contributor

Test build failed.

@twelho
Copy link

twelho commented Sep 27, 2025

I did now manage to rebase this atop master and run some additional tests, but it seems that even with shorter paths we unfortunately hit a bunch of other challenges:

  • virtiofsd is not in PATH, but this can be worked around by adding <binary path="/app/lib/extensions/bin/virtiofsd"/> to the filesystem configuration of the VM
  • Next, virtiofsd as configured by libvirt is using the namespace sandboxing method, expecting /etc/subuid and /etc/subgid to be present. This won't work inside a Flatpak. While virtiofsd has a none sandbox option, it's not an option in the libvirt schema. I worked around this using a wrapper script, since the virtiofsd seems to respect the last option it's given enabling us to override it. Note that libvirt still requires /etc/subuid and /etc/subgid to be present, but they can be empty.
  • Ultimately, the attempt ends in a "Connection refused" as libvirt attempts to connect to the virtiofsd socket. From what I can tell, virtiofsd is never launched, and for some reason it also doesn't work if I launch it by hand inside the Flatpak: libvirt still can't connect to the socket.

This is as far as I managed to look into it, step 1 would likely be to add the none sandbox option to libvirt if there are some other underlying assumptions it makes wrt. namespaces that break the functionality here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Error when starting a VM with VirtioFS device configured: "Unable to find a satisfying virtiofsd"

3 participants